home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 7302 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.5 KB

  1. Path: globe.indirect.com!fnf
  2. From: fnf@fishpond.ninemoons.com (Fred Fish)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Free native Amiga PowerPC tools available
  5. Date: 14 Apr 1996 07:28:20 GMT
  6. Organization: Cronus
  7. Message-ID: <4kq9ek$8rf@globe.indirect.com>
  8. NNTP-Posting-Host: amigalib.com
  9.  
  10. Just for grins, I decided to kill a couple hours today and try
  11. building an ADE PowerPC toolchain that runs native on the Amiga and
  12. generates AmigaDOS executable files containing PowerPC code rather
  13. than m68k code.  This includes the C, C++, and Objective C compilers,
  14. the assembler, the linker, and various other utilities like nm, ar,
  15. ranlib, etc.
  16.  
  17. Since I'd already done this once before as a cross compiler under
  18. linux, things actually went quite smoothly.  Note that like the m68k
  19. toolchain, the ppc toolchain does not yet use AmigaDOS hunk format
  20. object files.  For various reasons, it uses ELF rather than the a.out
  21. format used in the m68k toolchain.  Progress is being made though on
  22. using AmigaDOS hunk format for the default object file format in the
  23. m68k toolchain, and that will carry over quite easily to the ppc
  24. toolchain.
  25.  
  26. Basically building and installing a ppc toolchain from the ADE 960412
  27. binutils and gcc just involves just giving the following commands:
  28.  
  29.     mkdir /build/binutils /build/gcc
  30.     cd /build/binutils
  31.     sh /ade-src/fsf/binutils/configure -v \
  32.         --host=m68k-unknown-amigados \
  33.         --target=ppc-unknown-amigados
  34.     make install
  35.     cd /build/gcc
  36.     sh /ade-src/fsf/gcc/configure -v \
  37.         --host=m68k-unknown-amigados \
  38.         --target=ppc-unknown-amigados
  39.     make install
  40.  
  41. In practice, I had to make a couple of quick hacks to the gcc Makefile
  42. to get libgcc.a built, and apply a minor fix to binutils to get gas to
  43. compile.  If anyone wants these fixes they can email me.
  44.  
  45. I tested the toolchain by compiling and linking a simple C program
  46. that referenced no external functions (since there is no runtime
  47. library yet), using something like:
  48.  
  49.     ppc-unknown-amigados-gcc -O2 -S myfile.c
  50.     ppc-unknown-amigados-gcc -c myfile.s
  51.     ppc-unknown-amigados-gcc -nostdlib -o myfile myfile.o
  52.  
  53. I did it in three steps simply so I could examine the intermediate
  54. files, since I was curious about the assembly code and the structure
  55. of the ELF object file.  I did notice that some of the tools, like nm,
  56. fail to recognize the AmigaDOS hunk executable file format, but that
  57. is a bug I don't have time to chase today.
  58.  
  59. A compressed tar archive of the binary ppc toolchain is available in
  60. pub/ade/updates on ftp.ninemoons.com, as ppctools.tgz.  It should be
  61. used basically just for educational purposes, but if you happen to
  62. have a PowerPC board in your Amiga and can get it to execute something
  63. generated by these tools, I'd certainly like to hear about it.  Or
  64. better yet, send *me* one so I can support you.  :-)
  65.  
  66. To install the tools, assuming you have at least some of the other
  67. ADE tools installed (like gzip, tar, ixemul.library, gcc, etc), just
  68. do:
  69.  
  70.     cd gnu:
  71.     tar -xvzf path:ppctools.tgz
  72.  
  73. If anyone feels really ambitious, they can try building a cross gdb
  74. that includes the ppc simulator and run Amiga ppc executables inside
  75. the simulator.
  76.  
  77. Oh yes, if you find it tedious to type ppc-unknown-amigados-gcc every
  78. time you want to use the compiler, just link or copy it to some other
  79. name, like ppcgcc.
  80.  
  81. -Fred Fish  (fnf@ninemoons.com)
  82.  13-Apr-96
  83. -- 
  84. CRONUS  --  1840 E. Warner Road #105-265  --  Tempe, AZ 85284  --  USA
  85. Voice:  (800) 804-0833   --   (602) 491-0442  --  FAX:  (602) 491-0048
  86. Email:  info@ninemoons.com  --  WWW: http://www.ninemoons.com
  87. Ftp site: ftp.ninemoons.com
  88.  
  89.